﻿using Google.Protobuf.Compiler;
using MVVMDemo.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MVVMDemo.ViewModel
{
    public class UserEditFrmViewModel : INotifyPropertyChanged, IDataErrorInfo
    {
        public string this[string columnName] => throw new NotImplementedException();

        public string Error => throw new NotImplementedException();

        public event PropertyChangedEventHandler PropertyChanged;


        //private UserInfoModel _userInfoModel;
        //public UserInfoModel UserInfoModel
        //{
        //    get => _userInfoModel;
        //    set
        //    {
        //        _userInfoModel = value;
        //        OnPropertyChanged();
        //    }
        //}



        //// Validation logic, commands, and other properties...
        //public RelayCommand SaveCommand { get; }
        //public RelayCommand CancelCommand { get; }

        //public UserEditFrmViewModel(UserInfoModel initialUserInfoModel)
        //{
        //    UserInfoModel = initialUserInfoModel.Clone();

        //    SaveCommand = new RelayCommand(Save, CanSave);
        //    CancelCommand = new RelayCommand(CloseDialog);
        //}

        //private bool CanSave() => !HasValidationErrors; // Implement HasValidationErrors property

        //private async void Save()
        //{
        //    // Validate and save changes to the database, etc.
        //    // ...

        //    // Close the dialog if successful
        //    await DialogHost.CloseDialogAsync(true);
        //}

        //private void CloseDialog() => DialogHost.CloseDialogAsync(false);

    }
}
